Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for token-based usage metrics. #8757

Merged
merged 22 commits into from
Feb 24, 2025
Merged

Conversation

rlazo
Copy link
Contributor

@rlazo rlazo commented Feb 4, 2025

Token measurement is broken down by modaliy, with separate counters for image, audio, etc.

Tests are in version 6.*, so this change also includes bumping update_responses.sh

Internal API proposal doc: go/firebase-vertex-token-modality-api

rlazo added 2 commits February 4, 2025 11:47
Token measurement is broken down by modaliy, with separate counters for image, audio, etc.

Tests are in version 6.*, so this change also includes bumping update_responses.sh
@rlazo rlazo requested a review from a team as a code owner February 4, 2025 18:56
Copy link

changeset-bot bot commented Feb 4, 2025

🦋 Changeset detected

Latest commit: 6f90b2e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@firebase/vertexai Minor
firebase Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@rlazo rlazo requested review from hsubox76 and dlarocque February 4, 2025 18:56
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Feb 4, 2025

Size Report 1

Affected Products

  • @firebase/vertexai

    TypeBase (ce2c775)Merge (17c61cc)Diff
    browser33.7 kB34.0 kB+259 B (+0.8%)
    main34.7 kB34.9 kB+277 B (+0.8%)
    module33.7 kB34.0 kB+259 B (+0.8%)
  • firebase

    TypeBase (ce2c775)Merge (17c61cc)Diff
    firebase-vertexai.js27.5 kB27.6 kB+170 B (+0.6%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/UH4Qa3UJp9.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Feb 4, 2025

Size Analysis Report 1

Affected Products

  • @firebase/vertexai

    • ArraySchema

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size5.10 kB5.28 kB+180 B (+3.5%)
      size-with-ext-deps23.0 kB23.2 kB+183 B (+0.8%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      17 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      18 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      Modality
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      + Modality

    • BlockReason

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size3.01 kB3.19 kB+180 B (+6.0%)
      size-with-ext-deps20.9 kB21.1 kB+183 B (+0.9%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      17 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      18 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      Modality
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      + Modality

    • BooleanSchema

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size5.11 kB5.29 kB+180 B (+3.5%)
      size-with-ext-deps23.0 kB23.2 kB+183 B (+0.8%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      17 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      18 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      Modality
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      + Modality

    • ChatSession

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size15.3 kB15.5 kB+183 B (+1.2%)
      size-with-ext-deps34.2 kB34.4 kB+183 B (+0.5%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      30 dependencies

      BlockReason
      DEFAULT_API_VERSION
      DEFAULT_BASE_URL
      DEFAULT_FETCH_TIMEOUT_MS
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      LANGUAGE_TAG
      PACKAGE_VERSION
      POSSIBLE_ROLES
      SILENT_ERROR
      SchemaType
      Task
      VALID_PARTS_PER_ROLE
      VALID_PART_FIELDS
      VALID_PREVIOUS_CONTENT_ROLES
      VERTEX_TYPE
      badFinishReasons
      logger
      name
      responseLineRE
      version

      31 dependencies

      BlockReason
      DEFAULT_API_VERSION
      DEFAULT_BASE_URL
      DEFAULT_FETCH_TIMEOUT_MS
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      LANGUAGE_TAG
      Modality
      PACKAGE_VERSION
      POSSIBLE_ROLES
      SILENT_ERROR
      SchemaType
      Task
      VALID_PARTS_PER_ROLE
      VALID_PART_FIELDS
      VALID_PREVIOUS_CONTENT_ROLES
      VERTEX_TYPE
      badFinishReasons
      logger
      name
      responseLineRE
      version

      + Modality

    • FinishReason

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size3.01 kB3.19 kB+180 B (+6.0%)
      size-with-ext-deps20.9 kB21.1 kB+183 B (+0.9%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      17 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      18 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      Modality
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      + Modality

    • FunctionCallingMode

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size3.02 kB3.20 kB+180 B (+6.0%)
      size-with-ext-deps20.9 kB21.1 kB+183 B (+0.9%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      17 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      18 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      Modality
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      + Modality

    • GenerativeModel

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size18.1 kB18.2 kB+183 B (+1.0%)
      size-with-ext-deps37.0 kB37.2 kB+183 B (+0.5%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      30 dependencies

      BlockReason
      DEFAULT_API_VERSION
      DEFAULT_BASE_URL
      DEFAULT_FETCH_TIMEOUT_MS
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      LANGUAGE_TAG
      PACKAGE_VERSION
      POSSIBLE_ROLES
      SILENT_ERROR
      SchemaType
      Task
      VALID_PARTS_PER_ROLE
      VALID_PART_FIELDS
      VALID_PREVIOUS_CONTENT_ROLES
      VERTEX_TYPE
      badFinishReasons
      logger
      name
      responseLineRE
      version

      31 dependencies

      BlockReason
      DEFAULT_API_VERSION
      DEFAULT_BASE_URL
      DEFAULT_FETCH_TIMEOUT_MS
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      LANGUAGE_TAG
      Modality
      PACKAGE_VERSION
      POSSIBLE_ROLES
      SILENT_ERROR
      SchemaType
      Task
      VALID_PARTS_PER_ROLE
      VALID_PART_FIELDS
      VALID_PREVIOUS_CONTENT_ROLES
      VERTEX_TYPE
      badFinishReasons
      logger
      name
      responseLineRE
      version

      + Modality

    • HarmBlockMethod

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size3.02 kB3.20 kB+180 B (+6.0%)
      size-with-ext-deps20.9 kB21.1 kB+183 B (+0.9%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      17 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      18 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      Modality
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      + Modality

    • HarmBlockThreshold

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size3.02 kB3.20 kB+180 B (+6.0%)
      size-with-ext-deps20.9 kB21.1 kB+183 B (+0.9%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      17 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      18 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      Modality
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      + Modality

    • HarmCategory

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size3.01 kB3.19 kB+180 B (+6.0%)
      size-with-ext-deps20.9 kB21.1 kB+183 B (+0.9%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      17 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      18 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      Modality
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      + Modality

    • HarmProbability

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size3.02 kB3.20 kB+180 B (+6.0%)
      size-with-ext-deps20.9 kB21.1 kB+183 B (+0.9%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      17 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      18 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      Modality
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      + Modality

    • HarmSeverity

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size3.01 kB3.19 kB+180 B (+6.0%)
      size-with-ext-deps20.9 kB21.1 kB+183 B (+0.9%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      17 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      18 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      Modality
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      + Modality

    • ImagenAspectRatio

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size3.02 kB3.20 kB+180 B (+6.0%)
      size-with-ext-deps20.9 kB21.1 kB+183 B (+0.9%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      17 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      18 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      Modality
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      + Modality

    • ImagenImageFormat

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size3.30 kB3.48 kB+180 B (+5.5%)
      size-with-ext-deps21.2 kB21.4 kB+183 B (+0.9%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      18 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      SchemaType
      Task
      VERTEX_TYPE
      logger
      name
      version

      19 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      Modality
      SchemaType
      Task
      VERTEX_TYPE
      logger
      name
      version

      + Modality

    • ImagenModel

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size9.23 kB9.41 kB+180 B (+1.9%)
      size-with-ext-deps27.2 kB27.4 kB+183 B (+0.7%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      23 dependencies

      BlockReason
      DEFAULT_API_VERSION
      DEFAULT_BASE_URL
      DEFAULT_FETCH_TIMEOUT_MS
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      LANGUAGE_TAG
      PACKAGE_VERSION
      SchemaType
      Task
      VERTEX_TYPE
      logger
      name
      version

      24 dependencies

      BlockReason
      DEFAULT_API_VERSION
      DEFAULT_BASE_URL
      DEFAULT_FETCH_TIMEOUT_MS
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      LANGUAGE_TAG
      Modality
      PACKAGE_VERSION
      SchemaType
      Task
      VERTEX_TYPE
      logger
      name
      version

      + Modality

    • ImagenPersonFilterLevel

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size3.03 kB3.21 kB+180 B (+6.0%)
      size-with-ext-deps20.9 kB21.1 kB+183 B (+0.9%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      17 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      18 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      Modality
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      + Modality

    • ImagenSafetyFilterLevel

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size3.03 kB3.21 kB+180 B (+6.0%)
      size-with-ext-deps20.9 kB21.1 kB+183 B (+0.9%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      17 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      18 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      Modality
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      + Modality

    • IntegerSchema

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size5.11 kB5.29 kB+180 B (+3.5%)
      size-with-ext-deps23.0 kB23.2 kB+183 B (+0.8%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      17 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      18 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      Modality
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      + Modality

    • Modality

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size?3.19 kB? (?)
      size-with-ext-deps?21.1 kB? (?)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      functions?

      registerVertex

      ?
      classes?

      VertexAIService

      ?
      variables?

      18 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      Modality
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      ?
      enums??

      External Dependency

      ModuleBase (ce2c775)Merge (17c61cc)Diff
      @firebase/app?

      _registerComponent
      registerVersion

      ?
      @firebase/component?

      Component

      ?
      @firebase/logger?

      Logger

      ?
    • NumberSchema

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size5.10 kB5.28 kB+180 B (+3.5%)
      size-with-ext-deps23.0 kB23.2 kB+183 B (+0.8%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      17 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      18 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      Modality
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      + Modality

    • ObjectSchema

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size5.10 kB5.28 kB+180 B (+3.5%)
      size-with-ext-deps23.0 kB23.2 kB+183 B (+0.8%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      17 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      18 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      Modality
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      + Modality

    • POSSIBLE_ROLES

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size3.06 kB3.24 kB+180 B (+5.9%)
      size-with-ext-deps21.0 kB21.1 kB+183 B (+0.9%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      18 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      POSSIBLE_ROLES
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      19 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      Modality
      POSSIBLE_ROLES
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      + Modality

    • Schema

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size5.10 kB5.28 kB+180 B (+3.5%)
      size-with-ext-deps23.0 kB23.2 kB+183 B (+0.8%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      17 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      18 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      Modality
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      + Modality

    • SchemaType

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size3.01 kB3.19 kB+180 B (+6.0%)
      size-with-ext-deps20.9 kB21.1 kB+183 B (+0.9%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      17 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      18 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      Modality
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      + Modality

    • StringSchema

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size5.10 kB5.28 kB+180 B (+3.5%)
      size-with-ext-deps23.0 kB23.2 kB+183 B (+0.8%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      17 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      18 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      Modality
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      + Modality

    • VertexAIError

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size3.32 kB3.50 kB+180 B (+5.4%)
      size-with-ext-deps21.2 kB21.4 kB+183 B (+0.9%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      17 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      18 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      Modality
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      + Modality

    • VertexAIModel

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size4.49 kB4.67 kB+180 B (+4.0%)
      size-with-ext-deps22.4 kB22.6 kB+183 B (+0.8%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      17 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      18 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      Modality
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      + Modality

    • getGenerativeModel

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size18.2 kB18.4 kB+183 B (+1.0%)
      size-with-ext-deps37.2 kB37.4 kB+183 B (+0.5%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      30 dependencies

      BlockReason
      DEFAULT_API_VERSION
      DEFAULT_BASE_URL
      DEFAULT_FETCH_TIMEOUT_MS
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      LANGUAGE_TAG
      PACKAGE_VERSION
      POSSIBLE_ROLES
      SILENT_ERROR
      SchemaType
      Task
      VALID_PARTS_PER_ROLE
      VALID_PART_FIELDS
      VALID_PREVIOUS_CONTENT_ROLES
      VERTEX_TYPE
      badFinishReasons
      logger
      name
      responseLineRE
      version

      31 dependencies

      BlockReason
      DEFAULT_API_VERSION
      DEFAULT_BASE_URL
      DEFAULT_FETCH_TIMEOUT_MS
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      LANGUAGE_TAG
      Modality
      PACKAGE_VERSION
      POSSIBLE_ROLES
      SILENT_ERROR
      SchemaType
      Task
      VALID_PARTS_PER_ROLE
      VALID_PART_FIELDS
      VALID_PREVIOUS_CONTENT_ROLES
      VERTEX_TYPE
      badFinishReasons
      logger
      name
      responseLineRE
      version

      + Modality

    • getImagenModel

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size9.39 kB9.57 kB+180 B (+1.9%)
      size-with-ext-deps27.4 kB27.6 kB+183 B (+0.7%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      23 dependencies

      BlockReason
      DEFAULT_API_VERSION
      DEFAULT_BASE_URL
      DEFAULT_FETCH_TIMEOUT_MS
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      LANGUAGE_TAG
      PACKAGE_VERSION
      SchemaType
      Task
      VERTEX_TYPE
      logger
      name
      version

      24 dependencies

      BlockReason
      DEFAULT_API_VERSION
      DEFAULT_BASE_URL
      DEFAULT_FETCH_TIMEOUT_MS
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      LANGUAGE_TAG
      Modality
      PACKAGE_VERSION
      SchemaType
      Task
      VERTEX_TYPE
      logger
      name
      version

      + Modality

    • getVertexAI

      Size

      TypeBase (ce2c775)Merge (17c61cc)Diff
      size3.19 kB3.37 kB+180 B (+5.6%)
      size-with-ext-deps28.4 kB28.6 kB+183 B (+0.6%)

      Dependency

      TypeBase (ce2c775)Merge (17c61cc)Diff
      variables

      17 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      18 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      Modality
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      + Modality

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/20ZH0BSlfN.html

Copy link
Contributor

@hsubox76 hsubox76 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just need to add a changeset - yarn changeset, choose "@firebase/vertexai" (should already be selected) and "firebase" (won't be selected) and select "minor" for both. If you can't select "firebase" that's ok, you can also add 'firebase': minor manually in the resulting changeset file after it's created.

@rlazo rlazo requested review from a team as code owners February 8, 2025 04:49
@rlazo rlazo requested a review from hsubox76 February 11, 2025 15:44
@@ -213,4 +228,6 @@ export interface CountTokensResponse {
* from the request.
*/
totalBillableCharacters?: number;

promptTokensDetails?: ModalityTokenCount[];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want docs on this property? If so, add it in the same comment format as the two other properties above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added, thanks!

BTW, why are enums shown as (undocumented) in the generated .md file?

@rlazo rlazo requested a review from hsubox76 February 14, 2025 15:06
@rlazo rlazo requested a review from dlarocque February 18, 2025 22:00
@hsubox76
Copy link
Contributor

Oh sorry, can you run yarn docgen:all to actually generate the docs too? There should be a CI check that says that, but because since you didn't run it, the API report is out of date, which causes another CI workflow to run the API report and add an extra commit, which stops other CI workflows from running. It's kind of a catch-22. We should fix it. But yarn docgen:all plus another push should fix it.

@rlazo rlazo requested review from a team, avolkovi, sam-gc and yuchenshi as code owners February 19, 2025 23:25
Copy link
Contributor

github-actions bot commented Feb 19, 2025

Changeset File Check ✅

  • No modified packages are missing from the changeset file.
  • No changeset formatting errors detected.

// Point it to your entry point d.ts file.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, I needed to make this change otherwise the tool wouldn't run correctly. Should I leave it in the PR or remove it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about this again, this might be because of an updated rollup plugin dependency that was merged after you made this branch. The old plugin would write to the path you've updated it to, the new version writes to the new path - this change is causing the docgen step to fail in CI now.

Locally can you try deleting node_modules and reinstalling deps?

// in the root of the repo
rm -fr node_modules
yarn
// try docgen again
yarn docgen:all

@rlazo rlazo requested a review from rachelsaunders February 24, 2025 16:02
| Member | Value | Description |
| --- | --- | --- |
| AUDIO | <code>&quot;AUDIO&quot;</code> | Audio. |
| DOCUMENT | <code>&quot;DOCUMENT&quot;</code> | Document, e.g. PDF. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| DOCUMENT | <code>&quot;DOCUMENT&quot;</code> | Document, e.g. PDF. |
| DOCUMENT | <code>&quot;DOCUMENT&quot;</code> | Document (for example, PDF). |

@rlazo rlazo merged commit 9d82665 into main Feb 24, 2025
38 checks passed
@rlazo rlazo deleted the rl.token.count.js.modality branch February 24, 2025 17:30
@google-oss-bot google-oss-bot mentioned this pull request Feb 26, 2025
@firebase firebase locked and limited conversation to collaborators Mar 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants